-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use dynamic huffman tables to reduse the crate size. #35
Conversation
Looks like the build is failed due to |
@RazrFalcon Yeah, I think so. |
src/lib.rs
Outdated
5, 5, 5, 5, 5, 5, 5, 5, | ||
5, 5, 5, 5, 5, 5, 5, 5, | ||
5, 5, 5, 5, 5, 5, 5, 5 | ||
])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, you should .unwrap()
, sorry - these can't ever fail, they're effectively constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But why it returns 'Result' then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant these calls can't ever fail because they have constant arguments - for other inputs, those functions may return Err
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eddyb done.
This commit makes this crate 4x times smaller without performance changes.
Sizes from the
image-png
crate:Before:
After:
Benchmark results using libflate/flate_bench: